<?php
namespace Cohuna\Models;
use Phalcon\Di;

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/15 0015
 * Time: 9:24
 */
class CohunaConfig extends \Cohuna\Models\ModelBase
{
    public $config_id;
    public $config_name;
    public $config_key;
    public $config_value;
    public $create_time;
    public $update_time;

    public function getSource()
    {
        return Di::getDefault()->getShared('config')->database->default->prefix . 'config';
    }
    public function beforeUpdate()
    {
        $this->update_time = date('Y-m-d H:i:s');
    }
    public function beforeCreate()
    {
        $this->create_time = date('Y-m-d H:i:s');
    }
}